﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AdmBase;

public partial class admin_pages_faq_Default : TelaBase
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    private FaqBusiness fBusiness;

    public FaqBusiness FBusiness
    {
        get {
            if (fBusiness == null)
                fBusiness = new FaqBusiness();
            return fBusiness; }
        set { fBusiness = value; }
    }

    protected void SelectGrid(object sender, EventArgs e)
    {
        GridView grid = (GridView)sender;
        Response.Redirect("~/admin/pages/faq/Novo.aspx?id=" + grid.SelectedValue.ToString());
    }

    protected void Deletar(object sender, EventArgs e)
    {
        int id = int.Parse(((LinkButton)sender).CommandName);

        string msg = FBusiness.Deletar(id);
        DataBind();
        GridViewFaq.DataBind();
        ShowMensagem("Atenção", msg);
    }
    
}